#include <curl/curl.h>
#include <iostream>

int main()
{
    CURL *curl = curl_easy_init();
    if (curl)
    {
        curl_easy_setopt(curl, CURLOPT_URL, "ftp://user:pass@example.com/file.txt");
        curl_easy_setopt(curl, CURLOPT_NOBODY, 1L);
        CURLcode res = curl_easy_perform(curl);
        if (res == CURLE_OK)
        {
            long filesize;
            curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &filesize);
            std::cout << "File size: " << filesize << " bytes" << std::endl;
        }
        curl_easy_cleanup(curl);
    }
    return 0;
}